package com.shxzz.easy12306.framework.starter.idempotent.enums;

import lombok.Getter;

import java.util.Objects;

/**
 * 消息消费状态枚举类
 * @author shxzz
 * @create 2024-02-23-19:22
 */
public enum MessageConsumerStatus {
    CONSUMING("0"),
    CONSUMED("1"),
    ;

    /**
     * 状态码
     */
    @Getter
    private final String code;

    MessageConsumerStatus(String code) {
        this.code = code;
    }

    public static boolean isConsuming(String code) {
        return Objects.equals(code, CONSUMING.code);
    }
}
